/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package combinaciones;

/**
 *
 * @author Vivi
 */
public class AlarmaFactory implements IAlarmaFactoryMethod{

    @Override
    public ITipoProblema crearAlarma(String problema) {
        
            if(problema == "grave"){
                AlarmaGrave alarmagrave=new AlarmaGrave();
                alarmagrave.agregar(new Bomberos());
                alarmagrave.agregar(new CruzRoja());
                alarmagrave.agregar(new Policia());
                return alarmagrave;
            }
            if(problema =="leve"){
                AlarmaLeve alarmaLeve=new AlarmaLeve();
                alarmaLeve.agregar(new Policia());
                return alarmaLeve;
            }
            if(problema =="regular"){
                AlarmaRegular alarmaRegular=new AlarmaRegular();
                alarmaRegular.agregar(new Policia());
                alarmaRegular.agregar(new CruzRoja());
                return alarmaRegular;
            }
        
        return null;
    }

}
